-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for deleting expired aggregates #178
Conversation
5cc400c
to
c4cef02
Compare
Codecov Report
@@ Coverage Diff @@
## main #178 +/- ##
==========================================
+ Coverage 57.86% 58.48% +0.61%
==========================================
Files 58 58
Lines 3318 3365 +47
==========================================
+ Hits 1920 1968 +48
+ Misses 1270 1268 -2
- Partials 128 129 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
c4cef02
to
cc924c7
Compare
cc924c7
to
77ea806
Compare
aggregate.mutex.Lock() | ||
aggregate.cleanupExpiredEntries() | ||
aggregate.mutex.Unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to move the Lock()/Unlock()
inside aggregate.cleanupExpiredEntries()
as done in GetMetrics()
and UpdateByEntry()
time.Sleep(2 * time.Second) // still exists after 2 seconds | ||
require.Equal(t, 1, len(aggregates.Aggregates[0].GetMetrics())) | ||
time.Sleep(3 * time.Second) // expires after 3 more seconds (5 seconds in total) | ||
require.Equal(t, 0, len(aggregates.Aggregates[0].GetMetrics())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good comments
No description provided.